<html>
    <head>
        <title>test</title>
    </head>
    <body>
        <script src="/static/js/template.js"></script>
        <script id="tpl" type="text/html">
            <ul>
                <%for(var i = 0; i < list.length; i++) {%>
                <li><%:=list[i].name%></li>
                <%}%>
            </ul>
            </script>
        <script>
            var tpl = document.getElementById('tpl').innerHTML;
            document.write(template(tpl, {list: [{name: "yan"},{name: "haijing"}]}));
        </script>
    </body>
</html>